package com.guapi.schedule;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

import java.util.concurrent.ScheduledFuture;

public class ScheduleTask {
    public volatile ScheduledFuture<?> future;

    private static final Log log = LogFactory.get(ScheduleTask.class);

    public void cancel() {
        ScheduledFuture<?> future = this.future;
        if (future != null) {
            future.cancel(true);
            log.warn("------------定时任务已取消------------");
            log.warn(future.toString());
        }
    }
}
